There are systems for creating documents with mathematical content as well as systems for performing computations with mathematical expressions and for displaying the results of such computations. There are two basic methods of integrating such computations into a document. The first method integrates textual commands into the document that reference the mathematical algorithm that is to be applied to a mathematical expression and the result is displayed following this textual command. This method has the advantage that it is immediately obvious, from looking at the document, what algorithm was applied to an expression and how to reproduce the same operation elsewhere in the document or in a new document. The disadvantage is that the textual commands are often verbose and distract from the presentation of the document. The second method is to display the result, following the input expression and to display, between the two, a short text or symbol (e.g., an arrow) that describes the operation that was applied. This makes the document visually appealing and close to what one would expect to see in a mathematical textbook. There is no textual command or syntax that may be a distraction from the actual content that the document is supposed to convey. The disadvantage of this method is that, although the exact semantics of the operation can be preserved behind the scenes, in order to automatically update results if the input changes, the semantics of the operation are not obvious to a reader of the document. Because the presentation has to be visually appealing, the description of the operation has to be more casual or imprecise.
It is desirable to have a way of producing visually appealing documents that focus on the essential mathematical content that is to be conveyed as well as giving the reader access to the precise semantics of all the operations that are contained in the document.